#define  _CRT_SECURE_NO_WARNINGS 1

#include <iostream>
#include <string>

using namespace std;

void TestString()
{
	string str1("hello world!");
	cout << str1 << endl;
	cout << str1.c_str() << endl;
	cout << strlen(str1.c_str()) << endl;
	cout << str1.data() << endl;

	char arr[10] = "xxxxxxxxx";
	str1.copy(arr, 5, 0);
	for (auto ch : arr)
	{
		cout << ch << " ";
	}
	cout << endl;

	cout << str1.find("wo") << endl;

	string str2 = str1.substr(0, 5);
	cout << str2 << endl;
}

int main()
{
	TestString();

	return 0;
}